package com.dingwen.treasure.minio.config;

import io.minio.MinioClient;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 　MinioProperties： TODO 临时文件清理
 * 　@author dingwen
 * 　@date 2022/7/4
 */
@Configuration(proxyBeanMethods = false)
@ConfigurationProperties(prefix = "treasure.minio")
@Getter
@Setter
public class MinioConfig {

    /**
     * minio 地址
     */
    private String endpoint;

    /**
     * minio 用户名
     */
    private String accessKey;

    /**
     * secretKey 密码
     */
    private String secretKey;

    @Bean
    public MinioClient minioClient() throws Exception {
        return new MinioClient(endpoint, accessKey, secretKey);
    }
}
